<template>
  <el-pagination
    @size-change="SizeChange"
    @current-change="CurrentChange"
    @prev-click="prePage"
    @next-click="nextPage"
    :current-page="currentPage"
    :page-sizes="[1, 2, 3, 4]"
    :page-size="pageSize"
    layout="total, sizes, prev, pager, next, jumper"
    :total="sum"
  ></el-pagination>
</template>
<script>
import { createNamespacedHelpers } from "vuex";
const {
  mapState: mapStateGoods,
  mapActions: mapActionsGoods,
  mapMutations:mapMutationsGoods
} = createNamespacedHelpers("goods");
export default {
  computed:{
    ...mapStateGoods(["currentPage","pageSize","sum"])
  },
  watch:{
    currentPage(){
      this.getGoods()
    },
    pageSize(){
      this.getGoods()
    }
  },
  methods:{
    ...mapActionsGoods(["getGoods"]),
    ...mapMutationsGoods(["nextPage","prePage","SizeChange","CurrentChange"]),
  }
};
</script>

<style>
</style>